package shopping.event;

import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class DeleteEventHandler extends EventHandlerBase {
	private ResourceBundle bundle = ResourceBundle.getBundle("URL");

	@Override
	public String getURL_To_Dispatch() {
		return bundle.getString("DELETE"); //return "/EShop.jsp";
	}

	@Override
	public void process(HttpServletRequest request,	HttpServletResponse response) {
		
		int selectedIndex = Integer.parseInt(request.getParameter("delindex"));
		
		getCDList().remove(selectedIndex);
	}
}
